package com.test;

import java.util.Map;

public class QueryMaker {
	
	private String _query;
	
	public void createInsertQuery(String _table_name, 
			String _table_field_names, String _table_field_values){		
		_query = "insert into "+
				_table_name+" ("+_table_field_names+") values ("+_table_field_values+");";
		System.out.println(_query);
	}
	
	/*
	 * This function fetch the data from DB
	 * and return in key value pair.
	 * [
	 * 	if 3rd argument of function is true, means u have passed only one field, an it will help to get the 
	 * 	maximum value of field.
	 * 
	 * 	if its false then it will store the data in key value pair and return it.
	 * ]
	 * Method-Name:selectQuery
	 * Author: Dixit
	 * 
	 */
	public Map<String,String> selectQuery(String _table_name, 
			String _table_field_names, boolean _max_value){
		
		if(_max_value){
			_query = "select max("+ _table_field_names + ")" +
					" from "+ _table_name;
			System.out.println(_query);
		}
		else{
			String _fields[] = getTableFields(_table_field_names);
			_query = "select "+ _fields +
					" from "+ _table_name;
			System.out.println(_query);
		}
		
		return null;
		
		
	}
	/*
	 * This function will split the string into and store in array
	 * this will help to get keys from table fields
	 * Method-Name:getTableFields
	 * Author: Yukta
	 */
	private String[] getTableFields(String _table_field_names) {
		
		return null;
	}
	 
}
